import React, { Component } from 'react'

export default class Error extends Component {
  constructor() {
    super()
    this.state = {
      arr: [1,2,3,4]
    }
  }
  changeArr() {
    this.setState({
      arr: undefined
    })
  }
  render() {
    return (
      <div>
        <p onClick={()=>this.changeArr()}>{this.state.arr[0]}</p>
      </div>
    )
  }
}
